package com.example.javatwo.util;

import java.util.List;
/**
 * 分页公共类
 * @author Administrator
 *
 */
public class PageBead {
	private int everyPage; // 每页显示记录数
	private int totalCount; // 总记录数
	private int totalPage; // 总页数
	private int currentPage; // 当前页
	private int beginIndex; // 查询起始点
	private List<?> data;//数据源

	public int getEveryPage() {
		return everyPage;
	}

	public void setEveryPage(int everyPage) {
		this.everyPage = everyPage;
	}

	public int getTotalCount() {
		return totalCount;
	}

	public void setTotalCount(int totalCount) {
		this.totalCount = totalCount;
	}

	public int getTotalPage() {
		return (this.getTotalCount() % this.getEveryPage()) == 0 ? (this.getTotalCount() / this.getEveryPage())
				: (this.getTotalCount() / this.getEveryPage()) + 1;
	}

	public void setTotalPage(int totalPage) {
		this.totalPage = totalPage;
	}

	public int getCurrentPage() {
		return currentPage;
	}

	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}

	public int getBeginIndex() {
		return beginIndex;
	}

	public void setBeginIndex(int beginIndex) {
		this.beginIndex = beginIndex;
	}

	public List<?> getData() {
		return data;
	}

	public void setData(List<?> data) {
		this.data = data;
	}

	public PageBead() {
		super();
	}

	public PageBead(int everyPage, int totalCount, int currentPage, int beginIndex, List<?> data) {
		super();
		this.everyPage = everyPage;
		this.totalCount = totalCount;
		this.currentPage = currentPage;
		this.beginIndex = beginIndex;
		this.data = data;
	}

	@Override
	public String toString() {
		return "PageBead [everyPage=" + everyPage + ", totalCount=" + totalCount + ", totalPage=" + totalPage
				+ ", currentPage=" + currentPage + ", beginIndex=" + beginIndex + ", data=" + data + "]";
	}

}
